<template>
  <div>
    <h2><slot></slot></h2>

    <button @click="onClick">Increment async</button>
    <button @click="onClick2">Increment with step async</button>
  </div>
</template>

<script>
export default {
  name: 'Actions1',
  methods: {
    onClick() {
      // 通过 dispatch 访问 actions
      this.$store.dispatch('incrementAsync')
    },
    onClick2() {
      // 参数
      this.$store.dispatch('incrementWithStepAsync', 7)
    }
  }
}
</script>
